import LayoutVue from "@/views/layout/index.vue";
import LoginVue from "@/views/login/index.vue";
import {createRouter, createWebHashHistory} from "vue-router";
import ArticleCategory from "@/views/article/ArticleCategory.vue";
import ArticleManage from "@/views/article/ArticleManage.vue";
import UserAvatar from "@/views/user/UserAvatar.vue";
import UserInfo from "@/views/user/UserInfo.vue";
import UserResetPassword from "@/views/user/UserResetPassword.vue";
import UserPage from "@/views/user/index.vue";
import ScreenPage from "@/views/screen/index.vue";
import ReturnSchoolPage from "@/views/returnSchool/index.vue";
import AskPage from "@/views/ask/index.vue";

const routes =[
    {
        path: '/',
        component: LayoutVue,
        redirect: '/user',
        children: [
            {
                path: '/article/category',
                component: ArticleCategory
            },
            {
                path: '/article/manage',
                component: ArticleManage
            },
            {
                path: '/user/info',
                component: UserInfo
            },
            {
                path: '/user',
                component: UserPage
            },
            {
                path: '/returnSchool',
                component: ReturnSchoolPage
            },
            {
                path: '/ask',
                component: AskPage
            }
        ]
    },
    {
        path: '/login',
        component: LoginVue,
    },
    {
        path: '/screen',
        component: ScreenPage
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes: routes
})
export default router;